package test;

import java.util.Scanner;

//反转键盘录入的字符串    StringBuffer类下的reverse方法 字符串逆序
public class Test1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一段字符串");
        String str1 = scanner.next();
        StringBuffer str=new StringBuffer(str1);
        System.out.println("逆序之后为：");
        System.out.println(str.reverse());
    }
}
